<template>
  <div class="box">
    <a href="https://vitejs.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img :src="vueImg" class="logo vue" alt="Vue logo" />
    </a>
    {{ store.double }}
    <div id="yourScrollElementId" style="height: 100vh; overflow: auto">
      <div class="box1" id="test1">1</div>
      <div class="box1" id="test2">2</div>
      <div class="box1" id="test3">3</div>
      <div class="box1" id="test4">4</div>
      <div class="box1" id="test5">5</div>
      <div class="box1" id="test6">6</div>
    </div>
  </div>
  <HelloWorld msg="Vite + Vue" />
</template>
<script setup lang="ts">
import { observerFn, handleIntersectionObserver } from './test'
import { useCounterStore } from '@/store/modules/dome'
import vueImg from '@/assets/vue.svg'

const store = useCounterStore()
nextTick(() => {
  //   observerFn(
  //     ['#test1', '#test2', '#test3', '#test4', '#test5', '#test6'],
  //     entry => {
  //       console.log('entry', entry.target.id)
  //     }
  //   )
  handleIntersectionObserver(e => {
    console.log(e)
  }, 'yourScrollElementId') // 替换为您的特定滚动元素的ID
})
</script>
<style scoped lang="scss">
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
.box1 {
  height: 40vh;
  border: 1px solid;
}
</style>
